import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import '@/utils/flexble.js'
import plugins from './plugins' // plugins
import ElementUI from 'element-ui';
//样式文件需要单独引入
import '@/styles/element-variables.scss';

Vue.use(ElementUI);
Vue.use(plugins);


import PerfectScrollbar from 'vue2-perfect-scrollbar'
import 'vue2-perfect-scrollbar/dist/vue2-perfect-scrollbar.css'
Vue.use(PerfectScrollbar)


// 图片上传组件
import ImageUpload from "@/components/ImageUpload"
// 提交按钮
import SubmitBtn from "@/components/SubmitBtn.vue";
// 分页组件
import Pagination from "@/components/Pagination";
// 图片预览
import ImagePreview from "@/components/ImagePreview.vue";

Vue.component('ImageUpload', ImageUpload)
Vue.component('SubmitBtn', SubmitBtn);
Vue.component('Pagination', Pagination)
Vue.component('ImagePreview', ImagePreview)

// 过滤器
import filters from '@/filters/index.js'
Object.keys(filters).forEach(item => {
	Vue.filter(item, filters[item])
})

if(store.getters.token){
  store.dispatch('user/getUserInfo');
}


Vue.config.productionTip = false;
Vue.prototype.$bus = new Vue()
new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");



